<?php

namespace IUTINFO\ActionsComBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use DateTime;

/**
 * ActionDeCommunication
 *
 * @ORM\Table(schema="db_adc")
 * @ORM\Entity(repositoryClass="IUTINFO\ActionsComBundle\Entity\ActionDeCommunicationRepository")
 */
class ActionDeCommunication
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="titre", type="string", length=50)
     */
    private $titre;

    /**
     * @var string
     *
     * @ORM\Column(name="commentaire", type="string", length=2500)
     */
    private $commentaire;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date", type="date", options={"default" = "0000-00-00"})
     */
    private $date;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="dateLimiteInscription", type="date", options={"default" = "0000-00-00"})
     */
    private $dateLimiteInscription;

    /**
     * @var integer
     *
     * @ORM\Column(name="nombreEtudiant", type="integer", nullable=true)
     */
    private $nombreEtudiant;

    /**
     * @var integer
     *
     * @ORM\Column(name="nombreEtudiantMax", type="integer", nullable=true)
     */
    private $nombreEtudiantMax;

    /**
     * @var float
     * 
     * @ORM\Column(name="noteMax", type="float", options={"default" = "0.05"})
     */
    private $noteMax;
    
    /**
     * @var string
     *
     * @ORM\ManyToOne(targetEntity="IUTINFO\ActionsComBundle\Entity\Enseignant")
     */
    private $enseignant;
    
    /**
     * @var integer
     * 
     * @ORM\ManyToOne(targetEntity="IUTINFO\ActionsComBundle\Entity\Theme")
     */
    private $theme;

    /**
     * @var integer
     *
     * @ORM\ManyToOne(targetEntity="IUTINFO\ActionsComBundle\Entity\Etat")
     */
    private $etat;

    /**
     * @var boolean
     *
     * @ORM\Column(name="groupable", type="boolean", options={"default" = "0"})
     */
    private $groupable;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set titre
     *
     * @param string $titre
     * @return ActionDeCommunication
     */
    public function setTitre($titre)
    {
        $this->titre = $titre;

        return $this;
    }

    /**
     * Get titre
     *
     * @return string 
     */
    public function getTitre()
    {
        return $this->titre;
    }

    /**
     * Set commentaire
     *
     * @param string $commentaire
     * @return ActionDeCommunication
     */
    public function setCommentaire($commentaire)
    {
        $this->commentaire = $commentaire;

        return $this;
    }

    /**
     * Get commentaire
     *
     * @return string 
     */
    public function getCommentaire()
    {
        return $this->commentaire;
    }

    /**
     * Set date
     *
     * @param \DateTime $date
     * @return ActionDeCommunication
     */
    public function setDate($date)
    {
        $this->date = $date;

        return $this;
    }

    /**
     * Get date
     *
     * @return \DateTime 
     */
    public function getDate()
    {
    	$d = new DateTime("0000-00-00");
    	
    	if($this->date == $d)
    		return new DateTime("1970-01-01");
    	 
        return $this->date;
    }

    /**
     * Set dateLimiteInscription
     *
     * @param \DateTime $dateLimiteInscription
     * @return ActionDeCommunication
     */
    public function setDateLimiteInscription($dateLimiteInscription)
    {
        $this->dateLimiteInscription = $dateLimiteInscription;

        return $this;
    }

    /**
     * Get dateLimiteInscription
     *
     * @return \DateTime 
     */
    public function getDateLimiteInscription()
    {
    	$d = new DateTime("0000-00-00");
    	 
    	if($this->dateLimiteInscription == $d)
    		return new DateTime("1970-01-01");
    	
    	return $this->dateLimiteInscription;
    }

    /**
     * Set nombreEtudiant
     *
     * @param integer $nombreEtudiant
     * @return ActionDeCommunication
     */
    public function setNombreEtudiant($nombreEtudiant)
    {
        $this->nombreEtudiant = $nombreEtudiant;

        return $this;
    }

    /**
     * Get nombreEtudiant
     *
     * @return integer 
     */
    public function getNombreEtudiant()
    {
        return $this->nombreEtudiant;
    }

    /**
     * Set nombreEtudiantMax
     *
     * @param integer $nombreEtudiantMax
     * @return ActionDeCommunication
     */
    public function setNombreEtudiantMax($nombreEtudiantMax)
    {
        $this->nombreEtudiantMax = $nombreEtudiantMax;

        return $this;
    }

    /**
     * Get nombreEtudiantMax
     *
     * @return integer 
     */
    public function getNombreEtudiantMax()
    {
        return $this->nombreEtudiantMax;
    }

    /**
     * Set groupable
     *
     * @param boolean $groupable
     * @return ActionDeCommunication
     */
    public function setGroupable($groupable)
    {
        $this->groupable = $groupable;

        return $this;
    }

    /**
     * Get groupable
     *
     * @return boolean 
     */
    public function getGroupable()
    {
        return $this->groupable;
    }

    /**
     * Set theme
     *
     * @param \IUTINFO\ActionsComBundle\Entity\Theme $theme
     * @return ActionDeCommunication
     */
    public function setTheme(\IUTINFO\ActionsComBundle\Entity\Theme $theme = null)
    {
        $this->theme = $theme;

        return $this;
    }

    /**
     * Get theme
     *
     * @return \IUTINFO\ActionsComBundle\Entity\Theme 
     */
    public function getTheme()
    {
        return $this->theme;
    }

    /**
     * Set etat
     *
     * @param \IUTINFO\ActionsComBundle\Entity\Etat $etat
     * @return ActionDeCommunication
     */
    public function setEtat(\IUTINFO\ActionsComBundle\Entity\Etat $etat = null)
    {
        $this->etat = $etat;

        return $this;
    }

    /**
     * Get etat
     *
     * @return \IUTINFO\ActionsComBundle\Entity\Etat 
     */
    public function getEtat()
    {
        return $this->etat;
    }

    /**
     * Set enseignant
     *
     * @param \IUTINFO\ActionsComBundle\Entity\Enseignant $enseignant
     * @return ActionDeCommunication
     */
    public function setEnseignant(\IUTINFO\ActionsComBundle\Entity\Enseignant $enseignant = null)
    {
        $this->enseignant = $enseignant;

        return $this;
    }

    /**
     * Get enseignant
     *
     * @return \IUTINFO\ActionsComBundle\Entity\Enseignant 
     */
    public function getEnseignant()
    {
        return $this->enseignant;
    }

    /**
     * Set noteMax
     *
     * @param integer $noteMax
     * @return ActionDeCommunication
     */
    public function setNoteMax($noteMax)
    {
        $this->noteMax = $noteMax;

        return $this;
    }

    /**
     * Get noteMax
     *
     * @return integer 
     */
    public function getNoteMax()
    {
        return $this->noteMax;
    }
}
